package com.rc.saas.tenant.vo.log;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.rc.saas.tenant.common.base.BaseMongoEntity;
import com.rc.saas.tenant.common.constant.CommonConstant;
import com.rc.saas.tenant.common.utils.DateHelper;

import java.util.Date;

/**
 * 充电日志
 *
 * @Document 用来表明关联的mongo中的那个collection(类似于表名)
 * @Indexed 为某个字段建立索引
 * @Field 声明属性对应的数据库中的哪个字段
 */
//@Document(collection = "charge_process_log")
public class ChargedProcessLog extends BaseMongoEntity {
    @ExcelIgnore
    private String hlhtTenantCode;//SAAS互联互通运营商
    @ExcelIgnore
    private String hlhtOperatorId;//互联互通的operatorID
    @ExcelIgnore
    private String phase; //充电阶段
    @ExcelIgnore
    private String outOrderNum;
    @ExcelProperty(value = "订单号",index = 0)
    private String orderNum; //订单号
    @ExcelIgnore
    private String phaseTime; //充电阶段时间，如启动时间、采样时间、结束时间
    @ExcelProperty(value = "充电枪编号",index = 2)
    private String gunNo;   //枪编号
    @ExcelProperty(value = "充电桩短号",index = 3)
    private String pileSort; //桩短号
    @ExcelProperty(value = "站点名称",index = 4)
    private String stationName; //站点
    @ExcelProperty(value = "所属加盟商",index = 5)
    private String operatorName;//加盟商名称
    @ExcelProperty(value = "用户名",index = 6)
    private String nickName; //用户名
    @ExcelProperty(value = "车牌号",index = 7)
    private String carNumber;//车牌号
    @ExcelProperty(value = "枪温度(°C)",index = 8)
    private String temperatureGun; // 枪温度；
    @ExcelProperty(value = "功率",index = 9)
    private String gunPower;//枪输出功率
    @ExcelProperty(value = "当前电流(A)",index = 10)
    private String elec;//电流
    @ExcelProperty(value = "当前电压(V)",index = 11)
    private String voltage;//电压
    @ExcelProperty(value = "bms最大电压(V)",index = 13)
    private String demandVoltage;   // BMS当前需求电压；
    @ExcelProperty(value = "bms最大电流(A)",index = 12)
    private String demandElec;  // BMS当前需求电流；
    @ExcelProperty(value = "金额",index = 14)
    private String totalAmount;     //总金额
    @ExcelProperty(value = "soc(%)",index = 15)
    private String soc; //soc
    @ExcelIgnore
    private String orderStartTime;  //订单开始充电时间，用作分表的时间，很重要
    @ExcelIgnore
    private String mobile; //用户手机号码
    @ExcelIgnore
    private String power; //电量
    @ExcelIgnore
    private String pilePower;   //输出功率
    @ExcelIgnore
    private String connectorStatus; //充电设备接口状态
    @ExcelIgnore
    private String vin;     // vin码
    @ExcelIgnore
    private String elecPileFault;   //桩体停止原因
    @ExcelIgnore
    private String powerA;          //A枪总电量
    @ExcelIgnore
    private String powerB;          //B枪总电量
    @ExcelProperty(value = "通讯时间",index = 1)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private String createTime;  //日志创建时间

    /**
     * 按照订单的实现开始充电时间创建按月分表，而不是订单的生成时间
     * @param orderStartTime
     */
    public ChargedProcessLog(String orderStartTime) {
        Date date = DateHelper.stringToDate(orderStartTime, DateHelper.DATE_FORMAT_YYYY_MM_DD);
        this.collectionName = CommonConstant.CHARGED_PROCESS_LOG+ yyyyMM.format(date);
    }

    public String getHlhtTenantCode() {
        return hlhtTenantCode;
    }

    public void setHlhtTenantCode(String hlhtTenantCode) {
        this.hlhtTenantCode = hlhtTenantCode;
    }

    public String getHlhtOperatorId() {
        return hlhtOperatorId;
    }

    public void setHlhtOperatorId(String hlhtOperatorId) {
        this.hlhtOperatorId = hlhtOperatorId;
    }

    public String getPhase() {
        return phase;
    }

    public void setPhase(String phase) {
        this.phase = phase;
    }

    public String getPhaseTime() {
        return phaseTime;
    }

    public void setPhaseTime(String phaseTime) {
        this.phaseTime = phaseTime;
    }


    public String getGunNo() {
        return gunNo;
    }

    public void setGunNo(String gunNo) {
        this.gunNo = gunNo;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public String getOutOrderNum() {
        return outOrderNum;
    }

    public void setOutOrderNum(String outOrderNum) {
        this.outOrderNum = outOrderNum;
    }

    public String getOrderStartTime() {
        return orderStartTime;
    }

    public void setOrderStartTime(String orderStartTime) {
        this.orderStartTime = orderStartTime;
    }

    public String getSoc() {
        return soc;
    }

    public void setSoc(String soc) {
        this.soc = soc;
    }

    public String getPower() {
        return power;
    }

    public void setPower(String power) {
        this.power = power;
    }

    public String getVoltage() {
        return voltage;
    }

    public void setVoltage(String voltage) {
        this.voltage = voltage;
    }

    public String getElec() {
        return elec;
    }

    public void setElec(String elec) {
        this.elec = elec;
    }


    public String getConnectorStatus() {
        return connectorStatus;
    }

    public void setConnectorStatus(String connectorStatus) {
        this.connectorStatus = connectorStatus;
    }

    public String getDemandVoltage() {
        return demandVoltage;
    }

    public void setDemandVoltage(String demandVoltage) {
        this.demandVoltage = demandVoltage;
    }

    public String getDemandElec() {
        return demandElec;
    }

    public void setDemandElec(String demandElec) {
        this.demandElec = demandElec;
    }

    public String getVin() {
        return vin;
    }

    public void setVin(String vin) {
        this.vin = vin;
    }

    public String getElecPileFault() {
        return elecPileFault;
    }

    public void setElecPileFault(String elecPileFault) {
        this.elecPileFault = elecPileFault;
    }

    public String getPowerA() {
        return powerA;
    }

    public void setPowerA(String powerA) {
        this.powerA = powerA;
    }

    public String getPowerB() {
        return powerB;
    }

    public void setPowerB(String powerB) {
        this.powerB = powerB;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getCarNumber() {
        return carNumber;
    }

    public void setCarNumber(String carNumber) {
        this.carNumber = carNumber;
    }

    public String getGunPower() {
        return gunPower;
    }

    public void setGunPower(String gunPower) {
        this.gunPower = gunPower;
    }

    public String getPileSort() {
        return pileSort;
    }

    public void setPileSort(String pileSort) {
        this.pileSort = pileSort;
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    public String getTemperatureGun() {
        return temperatureGun;
    }

    public void setTemperatureGun(String temperatureGun) {
        this.temperatureGun = temperatureGun;
    }

    public String getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(String totalAmount) {
        this.totalAmount = totalAmount;
    }

    public String getPilePower() {
        return pilePower;
    }

    public void setPilePower(String pilePower) {
        this.pilePower = pilePower;
    }
}
